"use client" import * as React from 'react' import { Info } from 'lucide-react' import { Button } from '@open-mercato/ui/primitives/button' import { Input } from '@open-mercato/ui/primitives/input' import { Drawer, DrawerContent, DrawerHeader, DrawerTitle, DrawerDescription, DrawerBody, DrawerFooter, DrawerClose } from '@open-mercato/ui/primitives/drawer' import { SimpleTooltip } from '@open-mercato/ui/primitives/tooltip' import { useT } from '@open-mercato/shared/lib/i18n/context' import type { AgentDetailView } from '../../../../components/types' import { AutonomySegmented, ConfigField, NoticeBanner, SectionBand } from './workspacePrimitives' import { autonomyHintFallback, type Autonomy } from './workspaceShared' // Deliberately disabled (data-honesty spec §3.7): agents are defined in code for // now, and autonomy/spend/rate governance has no persistence — the drawer shows // the target UX without pretending to save. export function AgentConfigDrawer({ open, onOpenChange, agent, autonomy, }: { open: boolean onOpenChange: (open: boolean) => void agent: AgentDetailView autonomy: Autonomy }) { const t = useT() const defaultValue = t('agent_orchestrator.agentDetail.defaultValue', 'Default') const codeOnly = t( 'agent_orchestrator.agentDetail.actions.codeOnly', 'This agent is defined by its definition file in the repository — its prompt, tools, model and outcome schema all come from that file, which is the single source of truth. Configuring or pausing an agent from the UI is planned for the next version of Agent Orchestrator; for now, edit the definition in code and redeploy.', ) return ( {t('agent_orchestrator.agentDetail.config.title', 'Configure')} {agent.label || agent.id}
{t('agent_orchestrator.agentDetail.config.notice', 'Target UX — agents are defined in code for now; editing and saving need backend.')}
{t('agent_orchestrator.agentDetail.config.runtime', 'Runtime')}
{t('agent_orchestrator.agentDetail.config.governance', 'Governance')}

{t(`agent_orchestrator.agentDetail.autonomy.${autonomy}Hint`, autonomyHintFallback(autonomy))}

{/* The span carries the tooltip: a disabled button receives no pointer events, so hanging it on the button hides the one explanation of why Save cannot save. */}
) }